package com.qyhl.webtv.commonlib.utils.view.video.onlyprogressvideo;

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;

import com.qyhl.webtv.commonlib.R;
import com.shuyu.gsyvideoplayer.utils.GSYVideoType;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

public class OnlyProgressVideo extends StandardGSYVideoPlayer {
    public OnlyProgressVideo(Context context, Boolean fullFlag) {
        super(context, fullFlag);
    }

    public OnlyProgressVideo(Context context) {
        super(context);
    }

    public OnlyProgressVideo(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void touchSurfaceMoveFullLogic(float absDeltaX, float absDeltaY) {
        super.touchSurfaceMoveFullLogic(absDeltaX, absDeltaY);
        //不给触摸快进，如果需要，屏蔽下方代码即可
        mChangePosition = false;



        //不给触摸音量，如果需要，屏蔽下方代码即可
        mChangeVolume = false;

        //不给触摸亮度，如果需要，屏蔽下方代码即可
        mBrightness = false;
    }

    @Override
    protected void touchDoubleUp() {
        //super.touchDoubleUp();
        //不需要双击暂停
    }


    /**
     * 全屏收起按钮
     *
     * @return
     */
    @Override
    public int getShrinkImageRes() {
        return R.drawable.qy_video_to_normal_selector;
    }

    /**
     * 全屏展开按钮
     *
     * @return
     */
    @Override
    public int getEnlargeImageRes() {
        return R.drawable.qy_video_to_fullscreen_selector;
    }


    @Override
    protected int getTextureParams() {
        boolean typeChanged = (GSYVideoType.getShowType() != GSYVideoType.SCREEN_MATCH_FULL);
        return (typeChanged) ? ViewGroup.LayoutParams.WRAP_CONTENT : ViewGroup.LayoutParams.WRAP_CONTENT;
    }
}
